import request from '@/utils/request'

// 查询检验任务列表
export function listInspectionTask(query, config = {}) {
  return request({
    url: '/qep/inspection/task/listDTO',
    method: 'get',
    params: query,
    ...config
  })
}

// 查询检验任务详细
export function getInspectionTask(id, config = {}) {
  return request({
    url: '/qep/inspection/task/' + id,
    method: 'get',
    ...config
  })
}

// 新增检验任务
export function addInspectionTask(data, config = {}) {
  return request({
    url: '/qep/inspection/task',
    method: 'post',
    data: data,
    ...config
  })
}

// 修改检验任务
export function updateInspectionTask(data, config = {}) {
  return request({
    url: '/qep/inspection/task',
    method: 'put',
    data: data,
    ...config
  })
}

// 删除检验任务
export function delInspectionTask(id, config = {}) {
  return request({
    url: '/qep/inspection/task/' + id,
    method: 'delete',
    ...config
  })
}

// 导出检验任务
export function exportInspectionTask(query, config = {}) {
  return request({
    url: '/qep/inspection/task/export',
    method: 'post',
    params: query,
    ...config
  })
}

// 分配检验任务
export function assignInspectionTask(data, config = {}) {
  return request({
    url: '/qep/inspection/task/assign',
    method: 'put',
    data: data,
    ...config
  })
}

// 开始检验任务
export function startInspectionTask(id, config = {}) {
  return request({
    url: '/qep/inspection/task/start/' + id,
    method: 'put',
    ...config
  })
}

// 完成检验任务
export function finishInspectionTask(data, config = {}) {
  return request({
    url: '/qep/inspection/task/finish',
    method: 'put',
    data: data,
    ...config
  })
}

// 获取检验任务统计数据
export function getInspectionTaskStatistics(config = {}) {
  return request({
    url: '/qep/inspection/task/statistics',
    method: 'get',
    ...config
  })
}

// 生成检验任务编号
export function generateTaskCode(config = {}) {
  return request({
    url: '/qep/inspection/task/generateCode',
    method: 'get',
    ...config
  })
} 